package com.gallsoft.amidar;

public class BackgroundComponent extends GameComponent {

	private Texture mTexture;
    private RenderComponent mRenderComponent;
    private int mWidth, mHeight;
	
	public BackgroundComponent(int width, int height, RenderComponent render, Texture texture) {
		mTexture = texture;
		mWidth = width;
		mHeight = height;
		mRenderComponent = render;
		
		DrawableBitmap background = new DrawableBitmap(texture, width, height);
		mRenderComponent.setDrawable(background);
	}
	
	public void setUseTexture(Texture texture) {
		mTexture = texture;
	}
	
    public void setRenderComponent(RenderComponent render) {
        mRenderComponent = render;
    }
    
    public void setDrawable() {
		DrawableBitmap background = new DrawableBitmap(mTexture, mWidth, mHeight);
		mRenderComponent.setDrawable(background);
    }
}
